<%@page import="com.ksyzt.gwt.server.common.Util"%>
<%@page import="java.text.SimpleDateFormat"%>
<%@page import="com.ksyzt.ksite2.shared.modle.WATER_INFOObj"%>
<%@page import="com.ksyzt.ksite2.shared.modle.WATER_INFOObjs"%>
<%@page
	import="com.ksyzt.ksite2.server.database.dao.impl.WATER_INFODAOImpl"%>
<%@page import="com.ksyzt.ksite2.server.database.dao.IWATER_INFODAO"%>
<%@page import="com.ksyzt.ksite2.server.common.PageNaviData"%>
<%@page import="com.ksyzt.ksite2.shared.modle.VW_NEWSObj"%>
<%@page import="com.ksyzt.ksite2.shared.modle.VW_NEWSObjs"%>
<%@page import="com.ksyzt.ksite2.shared.PageData"%>
<%@page import="com.ksyzt.ksite2.server.common.Application"%>
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
	+ request.getServerName() + ":" + request.getServerPort()
	+ path + "/";
	Application app=new Application(request,response);
	PageData pd=app.getApplicationPageData();
	
	
	VW_NEWSObjs n_media=app.getColumnNews(20,5, false);
	VW_NEWSObjs n_water_news=app.getColumnNews(21,5, false);
	
	String TAGCOLUMN="tagcolumn";
	String TAGPICTURE="tagpicture";
	String stylish="stylish";
%>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<base href="<%=basePath%>" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title><%=pd.getName()%></title>
<meta http-equiv="pragma" content="no-cache" />
<meta http-equiv="cache-control" content="no-cache" />
<meta http-equiv="expires" content="0" />
<meta http-equiv="keywords" content="<%=pd.getKeyWords()%>" />
<meta http-equiv="description" content="<%=pd.getSummary()%>" />
<link rel="stylesheet" type="text/css" href="css/comm.css" />
<link rel="stylesheet" type="text/css" href="css/index.css" />

<script src="js/jquery.min.js" type="text/javascript"></script>
<script src="js/jquery.ksyzt.js" type="text/javascript"></script>
<script src="js/jquery.smallslider.js" type="text/javascript"></script>
<script type="text/javascript" src="js/swfobject.js"></script>


<script type="text/javascript">
var TAGCOLUMN='<%=TAGCOLUMN%>';
var TAGPICTURE='<%=TAGPICTURE%>';
	function load() {
		$(".stylish").makeStylish();

		$("div[tag='" + TAGCOLUMN + "']").makeColumn();

		$('#piccol18').smallslider({
			textPosition : 'top'
		});
		$('#piccol35').smallslider({
			switchEffect : 'ease',
			switchMode : 'click',
			switchPath : 'up',
			showText : false
		});

		$("#col68").scrollPicture().get(0).start();
		$("#col53").scrollPicture();

		$(".yqlj select").change(function() {
			var url = $(this).children('option:selected').val();
			if (url != "") {
				window.location = url;
			}
		});

		$("a").attr("target", "_blank");

	}

	$(document).ready(load);

	function setTab03Syn(i) {
		selectTab03Syn(i);
	}
	function selectTab03Syn(i) {
		switch (i) {
		case 1:
			$("#TabCon1").show();
			$("#TabCon2").hide();
			$("#font1").css("color", "#fff");
			$("#font2").css("color", "#000");
			break;
		case 2:
			$("#TabCon1").hide();
			$("#TabCon2").show();
			$("#font1").css("color", "#000");
			$("#font2").css("color", "#fff");
			break;
		}
	}
</script>
<script type="text/javascript" src="js/jquery.ksyzt.js"></script>
<style type="text/css">
.w270 {
	width: 270px;
	float: left;
}

.w694 {
	width: 700px;
	float: left;
}

.w694_line1 {
	width: 694px;
}

.w694_row1_col1 {
	width: 274px;
	overflow: hidden;
	float: left;
}

.w694_row1_col2 {
	width: 420px;
	overflow: hidden;
	float: left;
}

.w694_row2 {
	width: 694px;
	clear: both;
	float: left;
}
</style>
</head>
<body>

	<div class="wrap">
		<div class="wrap_center">
			<jsp:include page="include/top.jsp" />

			<!-- 广告栏-->
			<%=app.renderPictureColumn(null, 35, 5, false)%>

			<div class="w_970">
				<div class='w694'>
					<div class="w694_row1">
						<div class='w694_row1_col1'>
							<%=app.renderPictureColumn("tpzt", 18, 5, false)%>

							<!-- 公告通知 -->
							<div class="stylish {css:'tz'}">
								<%=app.column2html(19, new PageNaviData("", 5, 5, 0), false,
					false, app.ORDER_BY_DATE)%>
							</div>
						</div>
						<div class='w694_row1_col2'>
							<!-- 公司动态-->
							<div class="stylish {css:'gsdt'}">
								<%=app.column2html(18, new PageNaviData("", 14, 14, 0),
					false, false, app.ORDER_BY_DATE)%>
							</div>
						</div>
					</div>
					<div class="w694_row2">

						<div class="tab">
							<div id="bg" class="xixi1">
								<div class="tab1"
									onmouseover="setTab03Syn(1);document.getElementById('bg').className='xixi1'">

									<a id="font1" href="news/normal.jsp?cid=3&subcid=20">水利要闻</a>
								</div>
								<div class="tab2"
									onmouseover="setTab03Syn(2);document.getElementById('bg').className='xixi2'">
									<a id="font2" href="news/normal.jsp?cid=3&subcid=21">媒体关注</a>
								</div>
							</div>
							<div id="TabCon1">
								<ul>
									<%
										for (VW_NEWSObj n : n_media) {
											String link = n.getLINK();
											if (link == null || link.length() == 0) {
												link = "article/" + n.getID() + ".html";
											}
									%>
									<li><a href="<%=link%>" title=""><%=n.getTITLE()%></a><span><%=app.toDateString(n.getADDTIME())%></span>
									</li>
									<%
										}
									%>

								</ul>
							</div>
							<div id="TabCon2" style="display:none">
								<ul>
									<%
										for (VW_NEWSObj n : n_water_news) {
											String link = n.getLINK();
											if (link == null || link.length() == 0) {
												link = "article/" + n.getID() + ".html";
											}
									%>
									<li><a href="<%=link%>" title=""><%=n.getTITLE()%></a><span><%=app.toDateString(n.getADDTIME())%></span>
									</li>
									<%
										}
									%>
								</ul>
							</div>
						</div>

						<div class="stylish {css:'ztbd'}">
							<%=app.columncolumn2html(22, 5)%>
						</div>

					</div>
				</div>
				<div class='w270'>
					<div class="searchbar">
						<form style="display: inline;" action="news/search.jsp"
							method="get">
							<table style="float:right;margin-right:13px;margin-top:6px;"
								spacing="3px">
								<tr>
									<td><select name="type" class='search_select'>
											<option value="0" selected="selected">内容</option>
											<option value="1">标题</option>
									</select></td>
									<td><input name="w" style="width:130px" type="text"
										value="" />
									</td>
									<td><input type="submit" value="搜索" />
									</td>
								</tr>
							</table>
						</form>
					</div>
					<div class="dtx_box">
						<div class="top">
							<span class="title"><a href='news/normal.jsp?cid=2'>走进大藤峡</a>
							</span>
						</div>
						<div class="mid">
							<div class="flower">
								<a href="news/normal.jsp?cid=2&subcid=47" title="公司简介"
									class="btn_gsjj"></a> <a href="news/normal.jsp?cid=4&subcid=43"
									title="工程简介" class="btn_gcjj"></a> <a href="ldtd.html"
									title="领导信息" class="btn_ldxx"></a> <a
									href="news/normal.jsp?cid=51" title="大事记" class="btn_dsj"></a>
							</div>
						</div>
					</div>
					<%
						IWATER_INFODAO daowater = new WATER_INFODAOImpl(
								Application.getConnection());
						WATER_INFOObjs infos = daowater.getSpecificRecordByWhereTemplate(
								"order by updatetime desc", 0, 1);
						WATER_INFOObj info = null;

						if (infos.size() > 0)
							info = infos.get(0);
						else {
							info = new WATER_INFOObj();
							info.setUPDATETIME(Util.getCurrentSQLTimestamp());
						}

						SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
					%>
					<div class="water_box">
						<div class="top">
							<span class="title"><a href='news/water.jsp'>水情信息</a> </span>
						</div>
						<div class="mid"
							style="padding:8px 5px 5px 20px;font-size:14px;position:relative;">
							<div style="position:absolute;left:140px;top:80px;">
								<%
									String src = "images/luo.png";
									String trend = info.getTREND();
									if (trend.equals("涨")) {
										src = "images/zhang.png";
									} else if (trend.equals("平")) {
										src = "images/ping.png";
									}
								%>
								<img src="<%=src%>" alt="" />
							</div>
							<div style="font-size:16px;color:darkblue;font-weight:bold;">
								黔江*武宣站</div>
							<div style="font-size:14px;color:green;font-family:verdana;">
								<%=df.format(new Date(info.getUPDATETIME().getTime()))%>
							</div>
							<div style="font-size:14px;color:brown;padding-top:35px;">
								水位:<%=info.getSTAGE()%>
							</div>
							<div style="font-size:14px;color:brown;padding-top:15px;">
								警戒水位:<%=info.getALERT_STAGE()%>
							</div>
							<div style="font-size:14px;color:brown;padding-top:15px;">
								流量:<%=info.getFLUX()%>
							</div>
							<div
								style="font-size:12px;color:black;padding-top:40px;text-align: left;">
								<a style="padding-right:70px" href="news/water.jsp">查看详情</a> 来源：<a href='http://www.pearlwater.gov.cn/xxcx/syqxx/index.jsp'><%=info.getCOPYRIGHT()%></a>
							</div>
						</div>
						<div class="bottom"></div>
					</div>
				</div>

			</div>

			<div class="w_970">
				<!-- 党群工作-->
				<div class="stylish {css:'dqgz'}">
					<%=app.column2html(6, new PageNaviData("", 8, 8, 0), true,
					false, app.ORDER_BY_DATE)%>
				</div>

				<!-- 企业文化-->
				<div class="stylish {css:'qywh'}">
					<%=app.column2html(7, new PageNaviData("", 8, 8, 0), true,
					false, app.ORDER_BY_DATE)%>
				</div>
			</div>

			<!--图片中心-->
			<%=app.renderPictureColumn(68, 15, TAGPICTURE)%>


			<!-- 视频中心  -->
			<%=app.renderVideoColumn(53, 15, TAGPICTURE)%>


			<div class="w_970">

				<!--在线服务-->
				<div class="stylish {css:'zlxz'}">
					<%=app.column2html(11, new PageNaviData("", 8, 8, 0), true,
					false, app.ORDER_BY_DATE)%>
				</div>
				<!-- 电子刊物-->
				<div class="stylish {css:'dzkw'}">
					<%=app.column2html(25, new PageNaviData("", 8, 8, 0), true,
					false, app.ORDER_BY_DATE)%>
				</div>
			</div>

			<div class="w_970">
				<!-- 友情链接-->
				<%=app.renderColumn2(31, 0)%>
			</div>

		</div>
	</div>
	<jsp:include page="include/bottom.jsp" />
</body>
</html>
